/*
 * GunCMS Version 1.0.3
 * Copyright(c) 2009-2010, T & L GdbR
 * info@guncms.de
 * 
 * http://www.guncms.de
 */


function onRecommendToFriend(url, id,emailfield,msgDiv) {
	email = document.getElementById(emailfield);
	new Ajax.Request(url, {
	  method: 'post',
	  asynchronous: false,
	  parameters:'act=recomment&id=' + id+'&email='+$(emailfield).value,
	  onSuccess: function(transport) {
			var response = transport.responseText || "";
				var pos=response.indexOf('<!');
				content=response.substring(0,pos);
		    	//alert(content);
		    	$(msgDiv).innerHTML = '';
		    	if(content != "")
		    	{
		    		obj = content.evalJSON();
		    		ret=0;
		    		if(obj == null)
		    		{
		    			$(msgDiv).update('Something wrong! Reponsed string is: ' + content);
		    		}
			    	if(msgDiv != null)
				    	$(msgDiv).update(obj.message);
		    	}
			
			//alert(response);
			
		}
	});
	$(msgDiv).style.display = 'block';
	Fat.fade_element(msgDiv, null, 1500, null, null);
	
	return false;		
}

